package com.mentalhealthplatform.global.rbac.dto.normal;

import com.mentalhealthplatform.global.rbac.model.Permission;
import lombok.Getter;
import lombok.Setter;

public class PermissionDTO {

    // Getter 和 Setter 方法
    @Setter
    @Getter
    private Long id;
    @Setter
    @Getter
    private String identifier;
    @Setter
    @Getter
    private String permissionDisplayName;
    @Setter
    @Getter
    private Integer orderNum;
    @Setter
    @Getter
    private String displayName;


    // 默认构造函数
    public PermissionDTO() { }

    // 带参构造函数
    public PermissionDTO(Long id, String identifier, String permissionDisplayName, Integer orderNum) {
        this.id = id;
        this.identifier = identifier;
        this.permissionDisplayName = permissionDisplayName;
        this.orderNum = orderNum;
    }

    // 静态方法将 Permission 转换为 PermissionDTO
    public static PermissionDTO fromPermission(Permission permission) {
        return new PermissionDTO(permission.getId(), permission.getIdentifier(),permission.getDisplayName(),permission.getOrderNum());
    }




}

